﻿using System.Collections.Generic;

namespace Common.Library.StringExt.Randoms
{
    /// <summary>
    /// 随机生成手机号
    /// </summary>
    public class RandomMoble
    {

        static List<string> prefixList = new List<string>()
        {
            "130","131","132","133","134","135","136","137","138","139","147","150","151","152","153","155","156","157","158","159","186","187","188"
        };

        #region 随机生成一个手机号
        /// <summary>
        /// 随机生成一个手机号
        /// </summary>
        /// <returns></returns>
        public static string GetMoble()
        {
            //获取一个手机的 区号
            int index = RandomExt.GetNumber(1, prefixList.Count);
            string phone = prefixList[index];
            //在获取到手机号的后半段
            phone += RandomExt.GetNumber(10000000, 99999999);
            return phone;
        }
        #endregion
    }
}
